HAL FMAC constants migration

This section provides information about the HAL FMAC constants migration.

HAL FMAC buffer access modes constants

HAL1

HAL2

#define FMAC_BUFFER_ACCESS_DMA
#define FMAC_BUFFER_ACCESS_IT
#define FMAC_BUFFER_ACCESS_POLLING
#define FMAC_BUFFER_ACCESS_NONE

Removed; In HAL2, the input data is managed using the functions HAL_FMAC_WriteX1(), HAL_FMAC_WriteX1_IT(), HAL_FMAC_WriteX1_DMA(), and HAL_FMAC_WriteX1_DMA_Opt(). Similarly, output data is handled through HAL_FMAC_ReadY(), HAL_FMAC_ReadY_IT(), HAL_FMAC_ReadY_DMA(), and HAL_FMAC_ReadY_DMA_Opt(). and if we want another peripheral to handle the input or output data, we do not simply call read or write.

Note

In HAL2, the functions HAL_FMAC_LockX1WriteAccessForExternPeriph and HAL_FMAC_UnlockX1WriteAccessForExternPeriph are provided to safeguard the FMAC driver from unintended calls to the WriteX1 APIs when input data is managed by an external peripheral. Similarly, HAL_FMAC_LockYReadAccessForExternPeriph and HAL_FMAC_UnlockYReadAccessForExternPeriph protect the FMAC driver against accidental invocations of the ReadY APIs when output data is controlled by an external peripheral.

Related use cases:


HAL FMAC clip enable/disable states constants

HAL1

HAL2



#define FMAC_CLIP_DISABLED
#define FMAC_CLIP_ENABLED
typedef enum
{
  HAL_FMAC_CLIP_DISABLED,
  HAL_FMAC_CLIP_ENABLED
} hal_fmac_clip_status_t;

Related concepts:


HAL FMAC status flags constants

HAL1

HAL2




#define FMAC_FLAG_OVFL
#define FMAC_FLAG_SAT
#define FMAC_FLAG_UNFL
#define FMAC_FLAG_X1FULL
#define FMAC_FLAG_YEMPTY

Removed; In HAL1, these defines were used with __HAL_FMAC_GET_FLAG to verify the status of specific FMAC flags. In HAL2, all FMAC flag definitions have been removed and replaced by the following static inline functions

LL_FMAC_IsActiveFlag_OVFL /* To read overflow error flag */
LL_FMAC_IsActiveFlag_SAT /* To read saturation error flag */
LL_FMAC_IsActiveFlag_UNFL /* To read underflow error flag */
LL_FMAC_IsActiveFlag_X1FULL /* To read X1 buffer full flag */
LL_FMAC_IsActiveFlag_YEMPTY /* To read Y buffer empty flag */

HAL FMAC interrupt identifiers constants

HAL1

HAL2

#define FMAC_IT_OVFLIEN

Removed; Use LL_FMAC_EnableIT_OVFL / LL_FMAC_DisableIT_OVFL / LL_FMAC_IsEnabledIT_OVFL instead.

#define FMAC_IT_RIEN

Removed; Use LL_FMAC_EnableIT_RD / LL_FMAC_DisableIT_RD / LL_FMAC_IsEnabledIT_RD instead.

#define FMAC_IT_SATIEN

Removed; Use LL_FMAC_EnableIT_SAT / LL_FMAC_DisableIT_SAT / LL_FMAC_IsEnabledIT_SAT instead.

#define FMAC_IT_UNFLIEN

Removed; Use LL_FMAC_EnableIT_UNFL / LL_FMAC_DisableIT_UNFL / LL_FMAC_IsEnabledIT_UNFL instead.

#define FMAC_IT_WIEN

Removed; Use LL_FMAC_EnableIT_WR / LL_FMAC_DisableIT_WR / LL_FMAC_IsEnabledIT_WR instead.

Related concept:


HAL FMAC function modes constants

In HAL1, mode constants were specified as parameters within the FMAC_FilterConfigTypeDef structure. In HAL2, dedicated APIs have been introduced to handle this functionality.

HAL1

HAL2

#define FMAC_FUNC_CONVO_FIR

Removed; Use HAL_FMAC_StartFilterFIR to start the FIR filtering.

#define FMAC_FUNC_IIR_DIRECT_FORM_1

Removed; Use HAL_FMAC_StartFilterIIR to start the IIR filtering.

#define FMAC_FUNC_LOAD_X1

Removed; Use HAL_FMAC_PreloadX1 and HAL_FMAC_PreloadX1_DMA to preload X1 in polling and DMA modes.

#define FMAC_FUNC_LOAD_X2

Removed; Use HAL_FMAC_PreloadX1 to preload X2.

#define FMAC_FUNC_LOAD_Y

Removed; Use HAL_FMAC_PreloadX1 and HAL_FMAC_PreloadY_DMA to preload Yin polling and DMA modes.

Related concept:


HAL FMAC threshold values constants

In HAL1, the threshold values were specified using the InputThreshold and OutputThreshold fields within the FMAC_FilterConfigTypeDef structure. In HAL2, configuration is done via HAL_FMAC_SetX1FullWatermark for the FMAC X1 full watermark threshold, and HAL_FMAC_SetYEmptyWatermark for the FMAC Y empty watermark threshold. The threshold values are defined by the hal_fmac_watermark_threshold_t enumeration.

HAL1

HAL2



#define FMAC_THRESHOLD_1
#define FMAC_THRESHOLD_2
#define FMAC_THRESHOLD_4
#define FMAC_THRESHOLD_8
#define FMAC_THRESHOLD_NO_VALUE
typedef enum
{
   HAL_FMAC_WATERMARK_THRESHOLD_1,
   HAL_FMAC_WATERMARK_THRESHOLD_2,
   HAL_FMAC_WATERMARK_THRESHOLD_4,
   HAL_FMAC_WATERMARK_THRESHOLD_8,
} hal_fmac_watermark_threshold_t;

Related concept:


HAL FMAC error codes constants

HAL1

HAL2

#define HAL_FMAC_ERROR_NONE
#define HAL_FMAC_ERROR_SAT
#define HAL_FMAC_ERROR_UNFL
#define HAL_FMAC_ERROR_OVFL
#define HAL_FMAC_ERROR_DMA
#define HAL_FMAC_ERROR_TIMEOUT
#define HAL_FMAC_ERROR_NONE
#define HAL_FMAC_ERROR_SATURATION
#define HAL_FMAC_ERROR_UNDERFLOW
#define HAL_FMAC_ERROR_OVERFLOW
#define HAL_FMAC_ERROR_DMA
#define HAL_FMAC_ERROR_PRELOAD_TIMEOUT
#define HAL_FMAC_ERROR_INVALID_CALLBACK

Removed; The APIs will return HAL_INVALID_PARAM when the user provides null callback.

#define HAL_FMAC_ERROR_PARAM

Removed; The APIs will return HAL_INVALID_PARAM when the user provides invalid parameter.

#define HAL_FMAC_ERROR_RESET

Removed; The APIs will return HAL_ERROR when FMAC is not reset.

Related concept: